home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / June 96 / Re RE>Linking & ODF Draw < prev    next >
Encoding:
Internet Message Format  |  1996-12-03  |  3.1 KB  |  [TEXT/ttxt]

  1. Subject:     Re: RE>Linking & ODF Draw
  2. Sent:        6/4/96 3:41 PM
  3. Received:    6/4/96 3:51 PM
  4. From:        Mary Boetcher, mary_boetcher@quickmail.apple.com
  5. Reply-To:    ODF Interest, ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8. Mail*LinkĀ® SMTP               RE>RE>Linking & ODF Draw
  9.  
  10. Scott,
  11.  
  12. When ODFDraw externalizes its part content in CDrawPartContent::Externalize, it writes:
  13. 1) each shape in the shape list (CDrawContent::ExternalizeShapeList)
  14. 2) each link object (FW_CLinkManager::ExternalizeLinks)
  15. 3) part settings (CDrawPart::ExternalizeAnnotations)
  16.  
  17. When the shapes are written out in (1), they're assigned indices from 1..n. An index is just a tag to identify a particular shape, since you can't use ptrs inside a storage unit.
  18.  
  19. When the Link Manager externalizes the part's links in (2), it iterates over its lists of Link objects and calls ExternalizeLink for each one. The part's Link classes must override DoExternalizeLink in order to write out part-specific data. This data is used when the part is internalized, to re-create the link objects. 
  20.  
  21. ODFDraw's Link classes (CDrawPublishLink and CDrawSubscribeLink) keep track of what shapes are linked by means of content objects (CDrawLinkSourceContent* fPublishedContent and CDrawLinkContent* fLinkedContent, respectively). Each CDrawXxxContent object contains a shapeList inherited from the base class. When a CDrawPublish/SubscribeLink is externalized, we don't want to write out all of its linked shapes too, because they have already been written out by ExternalizeShapeList. Instead we simply iterate over the linked shapes and write out their indices.
  22.  
  23. When the part is internalized, first the part's shapes are read in and instantiated. Next the part's links are read, along with the shape indices. After a link object has been instantiated, it uses the indices to find the corresponding shapes and add them to its link content (see CDrawLinkManager::DoInternalizeOneSourceLink). Once the shapes have been added to the link content's shapeList, the indices are no longer needed.
  24.  
  25. >>Could you please explain or 
  26. >>point me to some documentation that would elaborate on exactly what I 
  27. >>am supposed to do to support linking? 
  28. The ODF Developer's Guide explains what you need to subclass and override to support Linking in your part.
  29.  
  30. >>You admitted there may be a bug in ODF Draw in this area.
  31. I looked at it some more, and now I think there is no problem. ODFDraw's CDrawSelectionContent::Internalize currently does not internalize links. If this is added in the future we'll have to be careful about how the shape indices are handled.
  32.  
  33. >>I am writing graphical shapes somewhat like Draw, but in the 
  34. >>part content, they are not stored sequentially, but they are stored 
  35. >>sequentially in the selection content. So, I can number them in the 
  36. >>selection or link content (and even the part content I suppose), but 
  37. >>I need to know how and when to do this.
  38. You need to identify each shape uniquely - the numbers do not have to be sequential. Perhaps you could use a shape's pointer as an unsigned long value.
  39.  
  40. Mary Boetcher
  41. ODF Person
  42.